package com.chen.manager.controller;

import com.chen.manager.service.SysUserRoleService;
import com.chen.model.dto.system.AssignRoleDto;
import com.chen.model.vo.common.Result;
import com.chen.model.vo.common.ResultCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author cgj
 * @date 2/20/25 7:47 PM
 */
@RestController
// url: `/admin/system/sysUserRole/assign`,
@RequestMapping("/admin/system/sysUserRole")
public class SysUserRoleController {
    /**
     * 给用户新增权限
     */
    @Autowired
    private SysUserRoleService sysUserRoleService;
    @PostMapping("/assign")
    public Result  assign(@RequestBody AssignRoleDto assignRoleDto){
          sysUserRoleService.assign(assignRoleDto);
          return Result.build(null, ResultCodeEnum.SUCCESS);

    }


}
